package com.example.web_flux.controller;

import com.example.web_flux.service.GoodsService;
import com.example.web_flux.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;

/**
 * @author luo
 * @description
 * @since 2022/8/17 13:59
 */
@RestController
@Slf4j
public class OrderController {

    private final OrderService orderService;

    @Resource(name="goodsServiceName")
    private List<GoodsService> goodsService;

    public OrderController(
            @Qualifier("main") OrderService orderService,
            @Qualifier("main") List<GoodsService> goodsService) {
        this.orderService = orderService;
//        this.goodsService = goodsService;
    }

    @PostConstruct
    public void show(){
        log.info("通过@Resource限定的集合：{}",goodsService);
    }
}
